<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <link rel="stylesheet" href="/css/index.css">
    <style>
        
    </style>
    <script>
        function func(value){
            var button0 = document.getElementById("nextStep_1")
            var button1 = document.getElementById("deleteKey")
            var button2 = document.getElementById("newProject")
            var button3 = document.getElementById("nextStep_2")
            var button4 = document.getElementById("enterInformation")
            var button5 = document.getElementById("nextStep_3")
            var button6 = document.getElementById("countNum")
            var button7 = document.getElementById("nextStep_4")
            var button8 = document.getElementById("queryRes")
            var button9 = document.getElementById("verifySign")
            var img1 = document.getElementById("pic_1")
            var img2 = document.getElementById("pic_2")
            var img3 = document.getElementById("pic_3")
            var img4 = document.getElementById("pic_4")

            if (value == "btn0"){
                button0.hidden = "hidden"
                button1.hidden = "hidden"
                button2.hidden = "hidden"
                button3.hidden = "hidden"
                button4.hidden = ""
                img1.style.WebkitFilter = "grayscale(80%)";
                img2.style.WebkitFilter = "grayscale(0%)";
                img3.style.WebkitFilter = "grayscale(80%)";
                img4.style.WebkitFilter = "grayscale(80%)";
            }
            if (value == "btn2"){
                button0.hidden = ""
            }
            if (value == "btn3"){
                button3.hidden = "hidden"
                button4.hidden = "hidden"
                button5.hidden = "hidden"
                button6.hidden = ""
                img1.style.WebkitFilter = "grayscale(80%)";
                img2.style.WebkitFilter = "grayscale(80%)";
                img3.style.WebkitFilter = "grayscale(0%)";
                img4.style.WebkitFilter = "grayscale(80%)";
            }
            if (value == "btn4"){
                button3.hidden = ""
            }
            if (value == "btn5"){
                button5.hidden = "hidden"
                button6.hidden = "hidden"
                button7.hidden = ""
                button8.hidden = ""
                button9.hidden = ""
                img1.style.WebkitFilter = "grayscale(80%)";
                img2.style.WebkitFilter = "grayscale(80%)";
                img3.style.WebkitFilter = "grayscale(80%)";
                img4.style.WebkitFilter = "grayscale(0%)";
            }
            if (value == "btn6"){
                button5.hidden = ""
            }
        }
        function autoClick(){
            var button1 = document.getElementById("newKey-btn")
            var button2 = document.getElementById("deleteKey-btn")

            button2.click()
            button1.click()
            // func("btn1")
        }

    </script>
</head>

<body>
{{template "top.html"}}
<!--<p id="ret">{{.}}</p>-->
<div class="page">
    <table class="img-tab">
        <tr>
            <td>
                <div class="firstPage">
                    <img id="pic_1" src="/css/img/login_bk_img.png" alt="">
                    <input id="nextStep_1" hidden="hidden" type="button" value="下一步>" name="btn0" onclick="func(name)">
                    <input id="deleteKey" type="button" value="重置密钥" name="btn1" onclick="autoClick()">
                    <input id="newProject" type="button" value="新建投票" name="btn2" onclick="func(name)">

                </div>
            </td>
            <td>
                <div class="enterInfo">
                    <img id="pic_2" src="/css/img/login_bk_img.png" alt="">
                    <input id="nextStep_2" hidden="hidden" type="button" value="下一步>" name="btn3" onclick="func(name)">
                <!-- @TODO 修改公网地址-->
                    <a href="https://404060p9q5.zicp.fun/entryCandidateInfo" target="_blank">
                        <button id="enterInformation" hidden="hidden" name="btn4" onclick="func(name)">录入选票信息</button>
                    </a>
                </div>
            </td>
            <td>
                <div class="statistics">
                    <img id="pic_3" src="/css/img/login_bk_img.png" alt="">
                    <input id="nextStep_3" hidden="hidden" type="button" value="下一步>" name="btn5" onclick="func(name)">
                    <!-- @TODO 修改公网地址-->
                    <a href="https://404060p9q5.zicp.fun/statistic" target="_blank"><!--@TODO 更改这个页面的跳转形式-->
                        <button id="countNum" hidden="hidden" name="btn6" onclick="func(name)">统计票数</button>
                    </a>
                </div>
            </td>
            <td>
                <img id="pic_4" src="/css/img/login_bk_img.png" alt="">
                <input id="nextStep_4" hidden="hidden" type="button" value="返回>" name="btn7" onclick="">
                <div class="query">
                    <!-- @TODO 修改公网地址-->
                    <a href="https://404060p9q5.zicp.fun/showResult" target="_blank">
                        <button id="queryRes" hidden="hidden" name="btn8">查看结果</button>
                    </a>
                </div>
                <div class="verify">
                    <!-- @TODO 修改公网地址-->
                    <a href="https://404060p9q5.zicp.fun/selectVoter" target="_blank">
                        <button id="verifySign" hidden="hidden" name="btn9">验证签名</button>
                    </a>
                </div>
            </td>
            </td>
        </tr>
    </table>
</div>

<div>
    <a href="https://404060p9q5.zicp.fun/createPublicKey">
        <button id="newKey-btn" hidden="hidden" name="btn10">
            创建Paillier密钥对(如不创建新的Paillier公钥则使用本地已有的密钥对)
        </button>
    </a>
</div>
<div class="deleteKey">
    <!-- @TODO 修改公网地址-->
    <a href="https://404060p9q5.zicp.fun/init">
        <button id="deleteKey-btn" hidden="hidden" name="btn11">
            初始化系统(删除已有的Paillier公钥)
        </button>
    </a>
</div>

<p id="retLabel1">{{.}}</p>
<p id="labelTape1"></p>



</body>
</html>